var max=0;function AsylumNavLink(parentId,linkId,order,href,linkText,target,width)
{this.linkId=linkId;this.parentId=parentId;this.order=order;this.href=href;this.linkText=linkText;this.target=target;this.width=width;};function AsylumNav(contId,layout,offset)
{this.menuCont=document.getElementById(contId);this.layout=layout;this.offset=(typeof offset=='undefined'?'Right':offset);this.menuItems=new Object();this.clickUnderCreated=false;};AsylumNav.prototype.AddLink=function(parentId,linkId,order,href,linkText,target,width)
{if(typeof this.menuItems[parentId]=='undefined')
{this.menuItems[parentId]=new Object();}
if(typeof width=="undefined")width=false;this.menuItems[parentId][linkId]=new AsylumNavLink(parentId,linkId,order,href,linkText,target,width);if(order>max){max=order;}};AsylumNav.prototype.CreateLevel=function(levelId,idPrefix)
{obj=this;div=document.createElement('div');div.id=idPrefix+levelId;div.levelId=levelId;div.idPrefix=idPrefix;div.className='levelDiv';div.onmouseout=function(e){obj.HideLevel(e);};div.subLevels=new Object();if(levelId!='0')
{div.style.visibility='hidden';div.className+=' subLevel';div.style.position='absolute';}
else
{div.className+=' topLevel';}
if(this.layout=='Horizontal')
{div.style.position='absolute';}
div.style.zIndex=10;if(this.menuCont){this.menuCont.appendChild(div);}
for(i=0;i<=max;i++){for(linkId in this.menuItems[levelId]){if(this.menuItems[levelId][linkId].order==i){linkDiv=document.createElement('div');linkDiv.id='asylumNavLinkDiv'+linkId;linkDiv.linkId=linkId;linkDiv.levelId=levelId;linkDiv.className='linkDiv';if(levelId=="0"){linkDiv.className+=" topLevel";if(this.menuItems[levelId][linkId].width){linkDiv.style.width=this.menuItems[levelId][linkId].width+"px";}}
div.appendChild(linkDiv);navLink=this.menuItems[levelId][linkId];a=document.createElement('a');a.id='asylumNavLink'+linkId;a.linkType='navMenu';a.linkId=linkId;a.levelId=navLink.parentId;a.parentId=navLink.parentId;if(navLink.href==''||navLink.href=='#')
{a.href='#';a.target='';a.style.cursor='default';}
else
{a.href=navLink.href;a.target=navLink.target;}
if(this.layout=='Vertical')
{a.innerHTML=navLink.linkText;}
else
{a.innerHTML=navLink.linkText.split(' ').join('&nbsp;');}
a.onmouseover=function(){obj.ShowLevel(this);};linkDiv.appendChild(a);if(linkId==pageId)
{a.className='activeLink';linkDiv.className+=' activeLink';topLink=this.GetTopLevelLink(navLink);if(typeof this.menuItems[topLink.linkId]!='undefined'&&navLink.levelId!='0')
{try{document.getElementById('asylumNavLink'+topLink.linkId).className+=' activeLink';document.getElementById('asylumNavLinkDiv'+topLink.linkId).className+=' activeLink';}catch(e){}}
if(document.getElementById("clickUnder")!=null)
{this.CreateClickUnder(topLink,true);}}
else
{}
if(typeof this.menuItems[linkId]!='undefined')
{div.subLevels[linkId]=true;}}}}
return div;};AsylumNav.prototype.Construct=function()
{if(this.menuCont==null){return;}
var obj=this;for(levelId in this.menuItems)
{this.CreateLevel(levelId,'asylumNavLevel');}
if(this.layout=='Vertical')
{if(typeof document.getElementById('tplMainSectors')!=null)
{ms=document.getElementById('tplMainSectors');ms.style.height=ms.offsetHeight;}}
else
{this.menuCont.style.height=document.getElementById('asylumNavLevel0').offsetHeight+'px';}
this.CreateBreadCrumbs();};AsylumNav.prototype.CreateClickUnder=function(navLink,active)
{if(typeof doneClickUnder=="undefined"){doneClickUnder=true;}else{return;}
if(document.getElementById("clickUnder")==null)return;obj=this;var linkId;if(this.layout=='Vertical')
{clickDiv=document.createElement('div');clickDiv.id="clickUnder";document.getElementById("clickUnder").appendChild(clickDiv);linkDiv=document.getElementById('asylumNavLinkDiv'+navLink.linkId);linkDiv.appendChild(clickDiv);}
else
{clickDiv=document.getElementById("clickUnder");}
var linkCount=0;for(linkId in this.menuItems[navLink.linkId])
{linkCount++;clickLinkDiv=document.createElement('div');clickLinkDiv.className='clickLinkDiv';clickLink=this.menuItems[navLink.linkId][linkId];txt=document.createTextNode(' ');clickDiv.appendChild(txt);a=document.createElement('a');a.id='asylumNavClickLink'+clickLink.linkId;a.className='clickLink';a.linkType='clickLink';a.linkId=linkId;a.levelId=clickLink.parentId;a.parentId=clickLink.parentId;if(clickLink.href==''||clickLink.href=='#'){a.href='#';a.target='';a.style.cursor='default';}else{a.href=clickLink.href;a.target=clickLink.target;}
if(this.layout=="Vertical"){a.innerHTML=clickLink.linkText;}else if(this.layout=="Horizontal-SubMenu"){if(clickLink.linkText.substring(0,1)==" "){a.innerHTML=clickLink.linkText.split(" ").join("&nbsp;");}else{a.innerHTML=clickLink.linkText;}}else{a.innerHTML=clickLink.linkText.split(" ").join("&nbsp;");}
a.onmouseover=function(){obj.HideAllLevels();obj.ShowLevel(this);};a.onmouseout=function(e){obj.HideLevel(e);};clickLinkDiv.appendChild(a);if(linkId==pageId)
{a.className='activeLink';clickLinkDiv.className+=' activeLink';}
clickDiv.appendChild(clickLinkDiv);txt=document.createTextNode(' ');clickDiv.appendChild(txt);}
if(linkCount==0||active==false)
{clickDiv.className='inactiveClickUnder';}
else
{clickDiv.className='activeClickUnder';}};AsylumNav.prototype.GetTopLevelLink=function(navLink)
{if(navLink.parentId=='0')
{return(navLink);}
while(1==1)
{navLink=this.GetParentLink(navLink);if(typeof navLink.parentId!='undefined')
{if(navLink.parentId=='0')
{break;}}}
return(navLink);};AsylumNav.prototype.GetParentLink=function(navLink)
{var levelId;var linkId;for(levelId in this.menuItems)
{for(linkId in this.menuItems[levelId])
{parNavLink=this.menuItems[levelId][linkId];if(parNavLink.linkId==navLink.parentId)
{return(parNavLink);}}}};AsylumNav.prototype.GetXPos=function(obj)
{var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent&&obj.id!='navMenuCont')
{curleft+=obj.offsetLeft;obj=obj.offsetParent;}}
else if(obj.x)
curleft+=obj.x;return curleft;};AsylumNav.prototype.GetYPos=function(obj)
{var curtop=0;if(obj.offsetParent)
{while(obj.offsetParent&&obj.id!='navMenuCont')
{curtop+=obj.offsetTop;obj=obj.offsetParent;}}
else if(obj.y)
curtop+=obj.y;return curtop;};AsylumNav.prototype.ShowLevel=function(el)
{levelId=el.linkId;this.currentLevelId=levelId;window.clearTimeout(this.timeoutId);this.HideSubLevels(el.levelId);if(typeof this.menuItems[levelId]=='undefined')
{return;}
if(el.linkType=='clickLink')
{eP=document.getElementById('asylumNavClickLink'+el.linkId);eL=document.getElementById('asylumNavLevel'+levelId);SwapClass(eL,'subLevel','clickUnderSubLevel');}
else
{eP=document.getElementById('asylumNavLink'+levelId);eL=document.getElementById('asylumNavLevel'+levelId);SwapClass(eL,'clickUnderSubLevel','subLevel');}
if(eP.parentId=='0')
{switch(this.offset)
{case'Right':offsetX=(eP.offsetWidth);offsetY=0;break;case'Left':offsetX=(-eL.offsetWidth);offsetY=0;break;case'Bottom':offsetX=0;offsetY=eP.offsetHeight;eL.style.minWidth=eP.offsetWidth;break;}}
else
{switch(this.offset)
{case'Left':offsetX=(-eL.offsetWidth);offsetY=0;break;default:offsetX=(eP.offsetWidth);offsetY=0;break;}}
pX=this.GetXPos(eP);pY=this.GetYPos(eP);lX=pX+offsetX;lY=pY+offsetY;eL.style.position='absolute';$(eL).css({left:lX,top:lY});eL.style.visibility='visible';};AsylumNav.prototype.GetLevelWidth=function(levelId)
{maxWidth=0;for(linkId in this.menuItems[levelId])
{a=document.getElementById('asylumNavLink'+linkId);thisWidth=a.offsetWidth;if(thisWidth>maxWidth)
{maxWidth=thisWidth;}}
return(maxWidth);};AsylumNav.prototype.HideSubLevels=function(levelId,omitLevelId)
{if(typeof omitLevelId=='undefined')
{omitLevelId='0';}
eL=document.getElementById('asylumNavLevel'+levelId);for(levelId in eL.subLevels)
{this.HideSubLevels(levelId);if(levelId!=omitLevelId)
{eL=document.getElementById('asylumNavLevel'+levelId);eL.style.visibility='hidden';}}};AsylumNav.prototype.HideLevel=function(e)
{window.clearTimeout(this.timeoutId);if(!e)e=window.event;var el=(e.relatedTarget)?e.relatedTarget:e.toElement;var obj=this;var funct=function(){obj._HideLevel(el);};this.timeoutId=window.setTimeout(funct,1000);};AsylumNav.prototype._HideLevel=function(el)
{if(!el||el.id.substr(0,9)!='asylumNav'||(el.id.substr(0,9)=='asylumNav'&&el.style.visibility=='hidden'))
{this.HideAllLevels();}};AsylumNav.prototype.HideAllLevels=function()
{for(levelId in this.menuItems)
{if(levelId!='0')
{eL=document.getElementById('asylumNavLevel'+levelId);if(eL!=null)eL.style.visibility='hidden';}}};AsylumNav.prototype.CreateBreadCrumbs=function()
{if(document.getElementById("breadCrumbs")!=null)
{crumbsCont=document.getElementById("breadCrumbs");crumbsCont.style.display='none';crumbs='';homeLink='';for(levelId in this.menuItems)
{for(linkId in this.menuItems[levelId])
{navLink=this.menuItems[levelId][linkId];if(homeLink=='')
{homeLink='<a href="'+navLink.href+'" target="'+navLink.target+'">'
+navLink.linkText+'</a> &gt; ';}
if(linkId==pageId)
{i=0;parNavLink=this.GetParentLink(navLink);while(typeof parNavLink=='object')
{i++;crumbs='<a href="'+parNavLink.href+'" target="'+parNavLink.target+'">'
+parNavLink.linkText+'</a> &gt; '+crumbs;parNavLink=this.GetParentLink(parNavLink);}
if(i>1)
{crumbsCont.style.display='block';crumbsCont.innerHTML=homeLink+crumbs+'<span class="activeCrumb">'+navLink.linkText+'</span>';}
return(true);}}}}};function RemoveClass(el,className)
{var replaceName=(el.className.match(' '+className)?' '+className:className);el.className=el.className.replace(replaceName,'');};function AddClass(el,className)
{RemoveClass(el,className);el.className+=' '+className;};function SwapClass(el,removeClassName,addClassName)
{RemoveClass(el,removeClassName);AddClass(el,addClassName);};;$(function() {for (var i in tasks) {window.setTimeout(tasks[i], 0);}});function initMenu(){};$(function(){$("#navMenu").navmenu({pageInfo:{"a300383":{"P":0,"ID":622927,"C":300383,"O":0,"U":"http:\/\/www.freedomsuzuki.co.nz\/","N":"Home","T":"_top","R":"","RT":"_blank"},"a300384":{"P":300383,"ID":505122,"C":300384,"O":"3","U":"http:\/\/www.freedomsuzuki.co.nz\/motorbike-sales-motorcycle.html","N":"About Us","T":"_top","R":"","RT":"_blank"},"a311000":{"P":300384,"ID":311122,"C":311000,"O":"1","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycles-motorbikes-fielding.html","N":"Careers","T":"_top","R":"","RT":"_blank"},"a300385":{"P":300383,"ID":627807,"C":300385,"O":"4","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycles-road-bikes.html","N":"Road Bikes","T":"_top","R":"","RT":"_blank"},"a330828":{"P":300385,"ID":378480,"C":330828,"O":"1","U":"http:\/\/www.freedomsuzuki.co.nz\/motorbikes-sport-road.html","N":"Sport and Road","T":"_top","R":"","RT":"_blank"},"a311016":{"P":300385,"ID":311124,"C":311016,"O":"2","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycles-gsx-r.html","N":"GSX-R","T":"_top","R":"","RT":"_blank"},"a311079":{"P":300385,"ID":311125,"C":311079,"O":"3","U":"http:\/\/www.freedomsuzuki.co.nz\/boulevard-motorbike-palmerston.html","N":"Boulevard","T":"_top","R":"","RT":"_blank"},"a311081":{"P":300385,"ID":311126,"C":311081,"O":"4","U":"http:\/\/www.freedomsuzuki.co.nz\/commuter-motorcycles-palmerston.html","N":"Commuter","T":"_top","R":"","RT":"_blank"},"a311107":{"P":300385,"ID":311127,"C":311107,"O":"5","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycle-finance-palmerston.html","N":"Finance &amp; Repayment Calculator","T":"_top","R":"","RT":"_blank"},"a311106":{"P":300385,"ID":311128,"C":311106,"O":"6","U":"http:\/\/www.freedomsuzuki.co.nz\/motorbike-palmerston-north.html","N":"Book a Test Ride","T":"_top","R":"","RT":"_blank"},"a507628":{"P":300383,"ID":507629,"C":507628,"O":"5","U":"http:\/\/www.freedomsuzuki.co.nz\/learners.html","N":"Learners","T":"_top","R":"","RT":"_blank"},"a507630":{"P":507628,"ID":507631,"C":507630,"O":"1","U":"http:\/\/www.freedomsuzuki.co.nz\/finance & repayment calculator.html","N":"Finance &amp; Repayment Calculator","T":"_top","R":"","RT":"_blank"},"a507633":{"P":507628,"ID":507634,"C":507633,"O":"2","U":"http:\/\/www.freedomsuzuki.co.nz\/book a test ride.html","N":"Book a Test Ride","T":"_top","R":"","RT":"_blank"},"a300386":{"P":300383,"ID":535617,"C":300386,"O":"6","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycles-off-road.html","N":"Off-Road Bikes","T":"_top","R":"","RT":"_blank"},"a311108":{"P":300386,"ID":311129,"C":311108,"O":"1","U":"http:\/\/www.freedomsuzuki.co.nz\/rmz-motorbikes-palmerston.html","N":"RM-Z","T":"_top","R":"","RT":"_blank"},"a311109":{"P":300386,"ID":311130,"C":311109,"O":"2","U":"http:\/\/www.freedomsuzuki.co.nz\/drz-motorcycles-palmerston.html","N":"DR-Z","T":"_top","R":"","RT":"_blank"},"a311110":{"P":300386,"ID":311131,"C":311110,"O":"3","U":"http:\/\/www.freedomsuzuki.co.nz\/dual-sport-motorbikes.html","N":"Dual Sport","T":"_top","R":"","RT":"_blank"},"a311111":{"P":300386,"ID":311132,"C":311111,"O":"4","U":"http:\/\/www.freedomsuzuki.co.nz\/kids-motorcycles-palmerston.html","N":"Youth","T":"_top","R":"","RT":"_blank"},"a506008":{"P":300386,"ID":506213,"C":506008,"O":"5","U":"http:\/\/www.freedomsuzuki.co.nz\/sport-atv.html","N":"Sport ATV","T":"_top","R":"","RT":"_blank"},"a505977":{"P":300386,"ID":506005,"C":505977,"O":"6","U":"http:\/\/www.freedomsuzuki.co.nz\/kids-4-wheelers-.html","N":"Youth ATV","T":"_top","R":"","RT":"_blank"},"a311112":{"P":300386,"ID":311133,"C":311112,"O":"7","U":"http:\/\/www.freedomsuzuki.co.nz\/motorbike-finance-palmerston.html","N":"Finance &amp; Repayment Calculator","T":"_top","R":"","RT":"_blank"},"a311113":{"P":300386,"ID":311134,"C":311113,"O":"8","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycle-test-ride.html","N":"Book a Test Ride","T":"_top","R":"","RT":"_blank"},"a300387":{"P":300383,"ID":604681,"C":300387,"O":"7","U":"http:\/\/www.freedomsuzuki.co.nz\/farm-bikes-motorbikes.html","N":"Farm Bikes","T":"_top","R":"","RT":"_blank"},"a311114":{"P":300387,"ID":311135,"C":311114,"O":"2","U":"http:\/\/www.freedomsuzuki.co.nz\/4-wheelers-motorcycles.html","N":"4 Wheelers","T":"_top","R":"","RT":"_blank"},"a311115":{"P":300387,"ID":311136,"C":311115,"O":"3","U":"http:\/\/www.freedomsuzuki.co.nz\/2-wheelers-motorbikes.html","N":"2 Wheelers","T":"_top","R":"","RT":"_blank"},"a332711":{"P":300387,"ID":332718,"C":332711,"O":"5","U":"http:\/\/www.freedomsuzuki.co.nz\/finance-motorbikes-palmerston.html","N":"Finance &amp; Repayment Calculator","T":"_top","R":"","RT":"_blank"},"a332778":{"P":300387,"ID":506653,"C":332778,"O":"6","U":"http:\/\/www.freedomsuzuki.co.nz\/motorbike-test-ride.html","N":"Book a Test Ride","T":"_top","R":"","RT":"_blank"},"a300388":{"P":300383,"ID":562360,"C":300388,"O":"8","U":"http:\/\/www.freedomsuzuki.co.nz\/used-bikes-motorcycles.html","N":"Used Bikes","T":"_top","R":"","RT":"_blank"},"a604684":{"P":300383,"ID":609601,"C":604684,"O":"9","U":"http:\/\/www.freedomsuzuki.co.nz\/demo-bikes.html","N":"Demonstrator Bikes","T":"_top","R":"","RT":"_blank"},"a300394":{"P":300383,"ID":506961,"C":300394,"O":"10","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycle-service-palmerston.html","N":"Service","T":"_top","R":"","RT":"_blank"},"a311116":{"P":300394,"ID":507527,"C":311116,"O":"1","U":"http:\/\/www.freedomsuzuki.co.nz\/motorbike-workshop-service.html","N":"Workshop Service","T":"_top","R":"","RT":"_blank"},"a311117":{"P":300394,"ID":506979,"C":311117,"O":"2","U":"http:\/\/www.freedomsuzuki.co.nz\/farm-service-motorbikes.html","N":"On Farm Service","T":"_top","R":"","RT":"_blank"},"a609283":{"P":300394,"ID":609284,"C":609283,"O":"3","U":"http:\/\/www.freedomsuzuki.co.nz\/book-service.html","N":"Book a Service","T":"_top","R":"","RT":"_blank"},"a311120":{"P":300383,"ID":594014,"C":311120,"O":"11","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycle-parts-accessories.html","N":"Parts &amp; Accessories","T":"_top","R":"","RT":"_blank"},"a311146":{"P":311120,"ID":499375,"C":311146,"O":"1","U":"http:\/\/www.freedomsuzuki.co.nz\/suzuki-genuine-parts.html","N":"Suzuki Genuine Parts","T":"_top","R":"","RT":"_blank"},"a311145":{"P":311120,"ID":530079,"C":311145,"O":"2","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycle-accessories-palmerston.html","N":"Accessories","T":"_top","R":"","RT":"_blank"},"a333408":{"P":311145,"ID":532975,"C":333408,"O":"1","U":"http:\/\/www.freedomsuzuki.co.nz\/road-bike-accessories.html","N":"Road Bike Accessories","T":"_top","R":"","RT":"_blank"},"a529617":{"P":311145,"ID":532953,"C":529617,"O":"2","U":"http:\/\/www.freedomsuzuki.co.nz\/boulevard-accessories.html","N":"Boulevard Accessories","T":"_top","R":"","RT":"_blank"},"a333412":{"P":311145,"ID":499382,"C":333412,"O":"3","U":"http:\/\/www.freedomsuzuki.co.nz\/dirt-bike-accessories.html","N":"Off-Road Bike Accessories","T":"_top","R":"","RT":"_blank"},"a333416":{"P":311145,"ID":499373,"C":333416,"O":"4","U":"http:\/\/www.freedomsuzuki.co.nz\/farm-bike-accessories.html","N":"Farm Bike Accessories","T":"_top","R":"","RT":"_blank"},"a534029":{"P":300383,"ID":573901,"C":534029,"O":"12","U":"http:\/\/www.freedomsuzuki.co.nz\/coming-events.html","N":"Coming Events","T":"_top","R":"","RT":"_blank"},"a311119":{"P":300383,"ID":507381,"C":311119,"O":"13","U":"http:\/\/www.freedomsuzuki.co.nz\/motorbike-news-info.html","N":"News &amp; Info","T":"_top","R":"","RT":"_blank"},"a505557":{"P":311119,"ID":505591,"C":505557,"O":"1","U":"http:\/\/www.freedomsuzuki.co.nz\/suzuki-news.html","N":"Suzuki News","T":"_top","R":"","RT":"_blank"},"a311148":{"P":311119,"ID":311156,"C":311148,"O":"2","U":"https:\/\/www.mtf.co.nz\/customer\/login.aspx?ReturnUrl=%2fcustomer%2fdefault.aspx","N":"MTF Customer Account Login","T":"_top","R":"https:\/\/www.mtf.co.nz\/customer\/login.aspx?ReturnUrl=%2fcustomer%2fdefault.aspx","RT":"_top"},"a300393":{"P":300383,"ID":505612,"C":300393,"O":"14","U":"http:\/\/www.freedomsuzuki.co.nz\/motorcycles-motorbikes-suzuki.html","N":"Contact Us","T":"_top","R":"","RT":"_blank"}},alignment:"Vertical",animate:0})});